import request from "@/utils/request";

/**
 * 分页查询用户
 * @param param
 * @returns {AxiosPromise}
 */
export function page(param) {
    return request({
        url: '/user/page',
        method: 'get',
        params: param
    })
}

/**
 * 启用用户
 * @param uuid
 * @returns {AxiosPromise}
 */
export function enable(uuid) {
    return request({
        url: '/user/enable/' + uuid,
        method: 'put',
    })
}

/**
 * 禁用用户
 * @param uuid
 * @returns {AxiosPromise}
 */
export function disable(uuid) {
    return request({
        url: '/user/disable/' + uuid,
        method: 'put',
    })
}

/**
 * 删除用户
 * @param uuid
 * @returns {*}
 */
export function deleted(uuid) {
    return request({
        url: '/user/delete/' + uuid,
        method: 'delete'
    })
}

/**
 * 导出用户
 * @returns {*}
 */
export function exportUser(param) {
    return request({
        url: '/user/export',
        method: 'post',
        params: param,
        responseType: 'blob'
    })
}

/**
 * 批量禁用
 * @returns {*}
 */
export function batchDisable(param) {
    return request({
        url: '/user/batch-disable',
        method: 'put',
        data: param
    })
}

/**
 * 批量启用
 * @returns {*}
 */
export function batchEnable(param) {
    return request({
        url: '/user/batch-enable',
        method: 'put',
        data: param
    })
}

/**
 * 批量删除
 * @returns {*}
 */
export function batchDelete(param) {
    return request({
        url: '/user/batch-delete',
        method: 'put',
        data: param
    })
}

/**
 * 获取用户详情
 * @returns {*}
 */
export function detail(uuid) {
    return request({
        url: '/user/detail/' + uuid,
        method: 'get',
    })
}

/**
 * 修改用户
 * @returns {*}
 */
export function update(param, uuid) {
    return request({
        url: '/user/update/' + uuid,
        method: 'put',
        data: param
    })
}

/**
 * 重置密码
 * @returns {*}
 */
export function resetPassword(uuid) {
    return request({
        url: '/user/reset-password/' + uuid,
        method: 'put'
    })
}



